﻿@using NB.MGJ.Model
@{
    Layout = null;
    Organization_Enterprise model = ViewBag.Enterprise as Organization_Enterprise;
    Sys_User user = ViewBag.User as Sys_User;
}
 <form id="form_EditUser" role="form" onkeydown="if(event.keyCode==13){return false;}">
    <div class="row">
        <div class="col-xs-2 col-md-2 text-right">
            <span style=" color:red;">*</span>
            登录账号：
        </div>
        <div class="col-xs-4 col-md-4">
            <input readonly="readonly" type="text" class="form-control" autocomplete="off" id="LoginName$value" name="LoginName" value="@user.LoginName" placeholder="" maxlength="50">
            <input type="hidden" name="ID" value="@user.ID" />
        </div>
        <div class="col-xs-2 col-md-2  text-right"><span style=" color:red;">*</span>所属机构：</div>
        <div class="col-xs-4 col-md-4">
            <input type="text" class="form-control" value="@ViewBag.EName" readonly="readonly" />
        </div>
    </div>
    <div class="row">
        <div class="col-xs-2 col-md-2 text-right">
            <span style=" color:red;">*</span>
            真实姓名：
        </div>
        <div class="col-xs-4 col-md-4">
            <input type="text" class="form-control" autocomplete="off" name="RealName" value="@user.RealName" placeholder="请输入真实姓名" maxlength="10">
        </div>


        <div class="col-xs-2 col-md-2  text-right">手机号：</div>
        <div class="col-xs-4 col-md-4">
            <input class="form-control" type="text" name="Modile" value="@user.Modile" maxlength="11" placeholder="请输入手机" />
        </div>

    </div>
    <div class="row">
        <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 text-right">
            <span>&nbsp;所在省：</span>
        </div>
        <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
            <select class="form-control" id="ProvinceId" name="Province">
                <option>所在省</option>
            </select>
        </div>
        <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 text-right">
            <span>&nbsp;所在市：</span>
        </div>
        <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
            <select class="form-control" id="City" name="City">
                <option>所在市</option>
            </select>
        </div>
    </div>

    @*<div class="row">
            <div class="col-xs-2 col-md-2 text-right">
                所属角色：
            </div>
            <div class="col-xs-10 col-md-10" id="Ajax_MultiRole">
            </div>
        </div>*@
    <div class="row">
        <div class="col-xs-2 col-md-2 text-right">
            备注：
        </div>
        <div class="col-xs-10 col-md-10">
            <input class="form-control" type="text" name="Remark" value="@user.Remark" />
        </div>

    </div>
</form>
<script>
    $(function () {
        $my.GetPCR('@user.Province', '@user.City', 0);
    })
    //input验证
    $('#form_EditUser').bootstrapValidator({
        message: '类型名称不能为空',
        excluded: [':disabled'],
        fields: {
            //LoginName: {
            //    validators: {
            //        notEmpty: {
            //            message: '登录账号不能为空'
            //        },
            //        threshold: 1, //有6字符以上才发送ajax请求，（input中输入一个字符，插件会向服务器发送一次，设置限制，6字符以上才开始）
            //        remote: {//ajax验证。server result:{"valid",true or false} 向服务发送当前input name值，获得一个json数据。例表示正确：{"valid",true}  
            //            type: "post",
            //            url: "/Manager/CheckUserName",
            //            message: '此登录账户已注册',
            //            delay: 2000
            //        },
            //        stringLength: {
            //            min: 4,
            //            max: 50,
            //            message: '登录账号长度必须在4到50位之间'
            //        },
            //        regexp: {
            //            regexp: /^\d{4,50}$/,
            //            message: '登录账号只能包含数字'
            //        }
            //    }
            //},
            Pwd: {
                validators: {
                    notEmpty: {
                        message: '密码不能为空'
                    }
                }
            },
            RealName: {
                validators: {
                    notEmpty: {
                        message: '真实姓名不能为空'
                    },
                    regexp: {
                        regexp: /^[a-zA-Z\u4e00-\u9fa5]+$/,
                        message: '真实姓名不能输入符号和数字'
                    },
                    stringLength: {
                        max: 10,
                        message: '真实姓名最大长度为10',
                    },
                }
            },
            Modile: {
                validators: {
                    regexp: {
                        regexp: /^1[0-9]{10}$/,
                        message: '手机号码格式错误'
                    }
                }
            }
        }
    });
</script>